package org.bonorsoft.modules.wechat.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.bonorsoft.modules.wechat.mapper.NywxPhotoMapper;
import org.bonorsoft.modules.wechat.service.INywxPhotoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 你有我需 图片处理
 */
@Service
@Slf4j
public class NywxPhotoServiceImpl implements INywxPhotoService {
    @Resource
    private NywxPhotoMapper nywxPhotoMapper;

    /**
     * 添加图片
     *
     * @param tjid
     * @param photo
     */
    @Override
    public int addPhoto(String tjid, String photo) {
        return nywxPhotoMapper.addPhoto(tjid,photo);
    }

    /**
     * 获取图片
     *
     * @param tjid
     * @return
     */
    @Override
    public List<String> getPhoto(String tjid) {
        return nywxPhotoMapper.getPhoto(tjid);
    }

    /**
     * 删除图片
     *
     * @param tjid
     */
    @Override
    public void deletePhoto(String tjid) {
        nywxPhotoMapper.deletePhoto(tjid);
    }

    /**
     * 批量删除
     *
     * @param ids
     */
    @Override
    public void deletePhotoByIds(List<String> ids) {
        for (String id : ids) {
            nywxPhotoMapper.deletePhoto(id);
        }
    }
}
